<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8"/>

	<link href="../css/self/mTable.css" type="text/css" rel="stylesheet"/>
</head>

<body>

	<div class="row bg-light">
		<div class="col-lg-4 col-sm-12 breadcrumb bg-light">
			<li class="breadcrumb-item">基础服务功能</li>
			<li class="breadcrumb-item"><a data-load-page="serverList" href="#">服务器资源管理</a></li>
			<li class="breadcrumb-item" id="server_ip">SSH用户管理</li>
		</div>
		<input type="hidden" id="server_name" />
		<div class="col-lg-8 col-sm-12">

			<div class="btn-group float-left my-sm-1 mr-5">
				<button class="btn btn-outline-primary" onclick="addSSH();">新增SSH</button>
				<button class="btn btn-outline-danger" onclick="delSSH();">删除SSH</button>
			</div>
		</div>
	</div>
	<div class="mt-3">
		<table id="ssh_list" >
		</table>
	</div>

</body>


<div class="modal fade" id="newSSH" tabindex="-1" role="dialog" aria-labelledby="newSSHHeader" aria-hidden="true">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title" id="newSSHHeader">新增SSH用户</h5>
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">×</span>
				</button>
			</div>

			<div class="modal-body">
				<div class="tab-pane active in" id="home">
					<form id="newSSHForm" class="form-horizontal">
						<input type="hidden" value="" name="group_id" id="group_id"/>
						<div class="form-group row ">
							<label for="SERVER_IP" class="col-sm-3 control-label form-control-label">用户名:</label>
							<div class="col-sm-9">
								<input type="text" class="form-control" name="SSH_NAME" id="SSH_NAME" placeholder="请输入用户名">
							</div>
						</div>
						<div class="form-group row ">
							<label for="SERVER_IP" class="col-sm-3 control-label form-control-label">用户密码:</label>
							<div class="col-sm-9">
								<input type="password" class="form-control" name="SSH_PWD" id="SSH_PWD" placeholder="请输入用户密码" autoComplete="new-password" >
								<input type="hidden" id="OLD_PWD" name="OLD_PWD" class="form-control">
							</div>
						</div>
						<div class="form-group row">
							<label class="col-sm-3 control-label form-control-label">服务类型:</label>
							<div class="col-sm-9">
								<div class="form-check form-check-inline mt-3">
									<label class="form-check-label">
										<input class="form-check-input" name="SERV_TYPE" type="checkbox" value="DB"> DB
									</label>
								</div>
								<div class="form-check form-check-inline mt-3">
									<label class="form-check-label">
										<input class="form-check-input" name="SERV_TYPE" type="checkbox"  value="MQ"> MQ
									</label>
								</div>
								<div class="form-check form-check-inline mt-3">
									<label class="form-check-label">
										<input class="form-check-input" name="SERV_TYPE" type="checkbox"  value="CACHE"> CACHE
									</label>
								</div>
							</div>
						</div>
					</form>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">关闭</button>
				<button type="button" onclick="saveSSH()" class="btn btn-primary ">提交</button>
			</div>
		</div>
	</div>

</div>
<!--
<div class="modal fade" id="newSSH" tabindex="-1" role="dialog" aria-labelledby="newSSHHeader" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					&times;
				</button>
				<h4 class="modal-title" id="newSSHHeader">新增SSH用户</h4>
			</div>
			
			<div class="modal-body">
				<div class="tab-pane active in" id="home">
					<form id="newSSHForm">
						<div>
							<label>用户名:</label>
							<div><input type="text" id="SSH_NAME" class="form-control"></div>
						</div>
						<div>
							<label>用户密码:</label>
							<div><input type="password" id="SSH_PWD" class="form-control"></div>
							<div style="display:none"><input type="password" id="OLD_PWD" class="form-control"></div>
						</div>
						<div>
							<label>服务类型:</label>
							<div style="float:left">
								<ul id="SERV_TYPE">
									<li><div class="checkbox">
										<input type="checkbox" value="DB" name="SERV_TYPE">DB
									</div></li>
									<li><div class="checkbox">
										<input type="checkbox" value="MQ" name="SERV_TYPE">MQ
									</div></li>
									<li><div class="checkbox">
										<input type="checkbox" value="CACHE" name="SERV_TYPE">CACHE
									</div></li>
								</ul>
							</div>
						</div>
					</form>
				</div>
			</div>
			<div class="modal-footer">
         		<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
         		<button type="button" onclick="saveSSH()" class="btn btn-primary">提交</button>
         	</div>
        </div>
    </div>
</div>-->

<script src="../js/self/mTable.js" type="text/javascript" ></script>
<script src="../js/sshList.js" type="text/javascript" ></script>
<script type="text/javascript">
	$(".breadcrumb>li>a").off("click").on("click",function(){
		var $this = $(this), pageName = $this.data("load-page"),$main = $("#mainContent");
		if(pageName != ""){
			/*$main.load("pages/"+pageName+".html");*/
			$(".contextMenu").remove();
			$main.load(pageName+".html",function(){
				initPage();
			});
		}
	});
</script>
</html>
